Index: lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/lib.php,v retrieving revision 1.484.2.18 diff -u -r1.484.2.18 lib.php --- lib.php 3 Aug 2007 13:18:02 -0000 1.484.2.18 +++ lib.php 6 Aug 2007 16:38:14 -0000 @@ -262,8 +262,7 @@ } } - -function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', +function build_mnet_logs_array($hostid, $course, $user=0, $startdate=0, $finishdate, $order="l.time ASC", $limitfrom='', $limitnum='', $modname="", $modid=0, $modaction="", $groupid=0) { global $CFG; @@ -337,9 +336,13 @@ $where .= " AND\n l.userid = '$user'"; } - if ($date) { - $enddate = $date + 86400; - $where .= " AND\n l.time > '$date' AND l.time < '$enddate'"; + if ($startdate) { + $enddate = $finishdate + 86400; + $joins[] = "l.time > '$startdate' AND l.time < '$enddate'"; + } + if ($startdate) { + $enddate = $finishdate + 86400; + $where .= " AND\n l.time > '$startdate' AND l.time < '$enddate'"; } $result = array(); @@ -353,7 +356,7 @@ return $result; } -function build_logs_array($course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', +function build_logs_array($course, $user=0, $startdate=0, $finishdate, $order="l.time ASC", $limitfrom='', $limitnum='', $modname="", $modid=0, $modaction="", $groupid=0) { // It is assumed that $date is the GMT time of midnight for that day, @@ -409,10 +412,10 @@ $joins[] = "l.userid = '$user'"; } - if ($date) { - $enddate = $date + 86400; - $joins[] = "l.time > '$date' AND l.time < '$enddate'"; - } + if ($startdate) { + $enddate = $finishdate + 86400; + $joins[] = "l.time > '$startdate' AND l.time < '$enddate'"; + } $selector = implode(' AND ', $joins); @@ -424,12 +427,12 @@ } -function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100, +function print_log($course, $user=0, $startdate=0, $finishdate=0, $order="l.time ASC", $page=0, $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0) { global $CFG; - if (!$logs = build_logs_array($course, $user, $date, $order, $page*$perpage, $perpage, + if (!$logs = build_logs_array($course, $user, $startdate, $finishdate, $order, $page*$perpage, $perpage, $modname, $modid, $modaction, $groupid)) { notify("No logs found!"); print_footer($course); @@ -538,13 +541,11 @@ print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&"); } - -function print_mnet_log($hostid, $course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100, +function print_mnet_log($hostid, $course, $user=0, $startdate=0, $finishdate=0, $order="l.time ASC", $page=0, $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0) { - global $CFG; - if (!$logs = build_mnet_logs_array($hostid, $course, $user, $date, $order, $page*$perpage, $perpage, + if (!$logs = build_mnet_logs_array($hostid, $course, $user, $startdate, $finishdate, $order, $page*$perpage, $perpage, $modname, $modid, $modaction, $groupid)) { notify("No logs found!"); print_footer($course); @@ -646,13 +647,13 @@ } -function print_log_csv($course, $user, $date, $order='l.time DESC', $modname, +function print_log_csv($course, $user, $startdate, $finishdate, $order='l.time DESC', $modname, $modid, $modaction, $groupid) { $text = get_string('course')."\t".get_string('time')."\t".get_string('ip_address')."\t". get_string('fullname')."\t".get_string('action')."\t".get_string('info'); - if (!$logs = build_logs_array($course, $user, $date, $order, '', '', + if (!$logs = build_logs_array($course, $user, $startdate, $finishdate, $order, '', '', $modname, $modid, $modaction, $groupid)) { return false; } @@ -725,14 +726,14 @@ } -function print_log_xls($course, $user, $date, $order='l.time DESC', $modname, +function print_log_xls($course, $user, $startdate, $finishdate, $order='l.time DESC', $modname, $modid, $modaction, $groupid) { global $CFG; require_once("$CFG->libdir/excellib.class.php"); - if (!$logs = build_logs_array($course, $user, $date, $order, '', '', + if (!$logs = build_logs_array($course, $user, $startdate, $finishdate, $order, '', '', $modname, $modid, $modaction, $groupid)) { return false; } @@ -838,14 +839,14 @@ return true; } -function print_log_ods($course, $user, $date, $order='l.time DESC', $modname, +function print_log_ods($course, $user, $startdate, $finishdate, $order='l.time DESC', $modname, $modid, $modaction, $groupid) { global $CFG; require_once("$CFG->libdir/odslib.class.php"); - if (!$logs = build_logs_array($course, $user, $date, $order, '', '', + if (!$logs = build_logs_array($course, $user, $startdate, $finishdate, $order, '', '', $modname, $modid, $modaction, $groupid)) { return false; } @@ -950,17 +951,16 @@ } -function print_log_graph($course, $userid=0, $type="course.png", $date=0) { +function print_log_graph($course, $userid=0, $type="course.png", $startdate=0, $finishdate=0, $modid=0, $modaction="") { global $CFG; if (empty($CFG->gdversion)) { echo "(".get_string("gdneed").")"; } else { echo ''; + '&user='.$userid.'&type='.$type.'&startdate='.$startdate.'&finishdate='.$finishdate.'&modid='.$modid.'&modaction='.$modaction.'" alt="" />'; } } - function print_overview($courses) { global $CFG, $USER; @@ -2671,4 +2671,99 @@ return false; } -?> +/** + * Select all log records for a given course + * + * @uses $CFG + * @uses DAYSECS + * @param int $courseid The id of the course as found in the 'course' table. + * @param string $coursestart ? + * @todo Finish documenting this function + */ +function get_logs_allusercourse($userid, $courseid, $startdate, $finishdate, $modid, $modaction) { + global $CFG; + + if ($userid != 0) { + $selector = 'userid = \''. $userid .'\' AND '; + } + + if ($modid !== 0) { + if ($modid == 'site_errors') { + $selector .= "( action='error' OR action='infected' ) AND "; + } else { + $selector .= 'cmid = \''. $modid .'\' AND '; + } + } + + if ($modaction !== '') { + $firstletter = substr($modaction, 0, 1); + if (ctype_alpha($firstletter)) { + $selector .= "lower(action) LIKE '%" . strtolower($modaction) . "%'" . " AND "; + } else if ($firstletter == '-') { + $selector .= "lower(action) NOT LIKE '%" . strtolower(substr($modaction, 1)) . "%'" . " AND "; + } + } + + if ($courseid) { + $courseselect = ' AND course = \''. $courseid .'\' '; + } else { + $courseselect = ''; + } + + $finishdate = $finishdate + DAYSECS; + + return get_records_sql("SELECT floor((time - $startdate)/". DAYSECS .") as day, count(*) as num + FROM {$CFG->prefix}log + WHERE $selector time > '$startdate' AND time <= '$finishdate' $courseselect + GROUP BY day "); +} + +/** + * Select all log records for a given course and day + * + * @uses $CFG + * @uses HOURSECS + * @param int $courseid The id of the course as found in the 'course' table. + * @param string $daystart ? + * @return object + * @todo Finish documenting this function + */ +function get_logs_alluserday($userid, $courseid, $daystart, $modid, $modaction) { + global $CFG; + + if ($userid != 0) { + $selector = 'userid = \''. $userid .'\' AND '; + } + + if ($modid !== 0) { + if ($modid == 'site_errors') { + $selector .= "( action='error' OR action='infected' ) AND "; + } else { + $selector .= 'cmid = \''. $modid .'\' AND '; + } + } + + if ($modaction !== '') { + $firstletter = substr($modaction, 0, 1); + if (ctype_alpha($firstletter)) { + $selector .= "lower(action) LIKE '%" . strtolower($modaction) . "%'" . " AND "; + } else if ($firstletter == '-') { + $selector .= "lower(action) NOT LIKE '%" . strtolower(substr($modaction, 1)) . "%'" . " AND "; + } + } + + if ($courseid) { + $courseselect = ' AND course = \''. $courseid .'\' '; + } else { + $courseselect = ''; + } + + $dayfinish = $daystart + DAYSECS; + + return get_records_sql("SELECT floor((time - $daystart)/". HOURSECS .") as hour, count(*) as num + FROM {$CFG->prefix}log + WHERE $selector time > '$daystart' AND time <= '$dayfinish' $courseselect + GROUP BY hour "); +} + +?> \ No newline at end of file Index: report/log/graph.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/report/log/graph.php,v retrieving revision 1.4 diff -u -r1.4 graph.php --- report/log/graph.php 25 Aug 2006 08:51:50 -0000 1.4 +++ report/log/graph.php 6 Aug 2007 16:32:12 -0000 @@ -8,7 +8,11 @@ $id = required_param('id', PARAM_INT); // Course ID $type = required_param('type', PARAM_FILE); // Graph Type $user = optional_param('user', 0, PARAM_INT); // Student ID - $date = optional_param('date', 0, PARAM_INT); // A time of a day (in GMT) + $startdate = optional_param('startdate', 0, PARAM_INT); // A time of a start day (in GMT) + $finishdate = optional_param('finishdate', 0, PARAM_INT); // A time of a finish day (in GMT) + $modid = optional_param('modid', 0, PARAM_FILE); // number or 'site_errors' + $modaction = optional_param('modaction', '', PARAM_PATH); // an action as recorded in the logs + $currentcharset = get_string('thischarset'); if (! $course = get_record("course", "id", $id)) { error("Course is misconfigured"); @@ -56,16 +60,16 @@ } } - $timestart = $coursestart = usergetmidnight($course->startdate); + $timestart = $coursestart = $startdate; - if ((($timenow - $timestart)/86400.0) > 40) { + if ((($finishdate - $startdate)/86400.0) > 40) { $reducedays = 7; } else { $reducedays = 0; } $i = 0; - while ($timestart < $timenow) { + while ($timestart <= $finishdate) { $timefinish = $timestart + 86400; if ($reducedays) { if ($i % $reducedays) { @@ -81,7 +85,7 @@ $timestart = $timefinish; } - if ($rawlogs = get_logs_usercourse($user->id, $courseselect, $coursestart)) { + if ($rawlogs = get_logs_allusercourse($user->id, $courseselect, $startdate, $finishdate, $modid, $modaction)) { foreach ($rawlogs as $rawlog) { $logs[$rawlog->day] = $rawlog->num; } @@ -90,7 +94,11 @@ $graph = new graph(750, 400); $a->coursename = $course->shortname; - $a->username = fullname($user, true); + if ($user->id == 0){ + $a->username = get_string('allparticipants'); + } else { + $a->username = fullname($user, true); + } $graph->parameter['title'] = get_string("hitsoncourse", "", $a); $graph->x_data = $days; @@ -112,7 +120,7 @@ $graph->parameter['x_label_angle'] = 0; $graph->parameter['tick_length'] = 0; - + $graph->parameter['shadow'] = 'none'; error_reporting(5); // ignore most warnings such as font problems etc @@ -123,15 +131,15 @@ case "userday.png": $site = get_site(); - + if ($course->id == $site->id) { $courseselect = 0; } else { $courseselect = $course->id; } - if ($date) { - $daystart = usergetmidnight($date); + if ($startdate) { + $daystart = usergetmidnight($startdate); } else { $daystart = usergetmidnight(time()); } @@ -143,7 +151,7 @@ $hours[$i] = $i; } - if ($rawlogs = get_logs_userday($user->id, $courseselect, $daystart)) { + if ($rawlogs = get_logs_alluserday($user->id, $courseselect, $daystart, $modid, $modaction)) { foreach ($rawlogs as $rawlog) { $logs[$rawlog->hour] = $rawlog->num; } @@ -152,8 +160,12 @@ $graph = new graph(750, 400); $a->coursename = $course->shortname; - $a->username = fullname($user, true); - $graph->parameter['title'] = get_string("hitsoncoursetoday", "", $a); + if ($user->id == 0){ + $a->username = get_string('allparticipants'); + } else { + $a->username = fullname($user, true); + } + $graph->parameter['title'] = get_string("hitsoncourse", "", $a); $graph->x_data = $hours; Index: report/log/index.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/report/log/index.php,v retrieving revision 1.13.2.2 diff -u -r1.13.2.2 index.php --- report/log/index.php 3 Aug 2007 13:18:00 -0000 1.13.2.2 +++ report/log/index.php 6 Aug 2007 10:38:00 -0000 @@ -23,6 +23,10 @@ $group = optional_param('group', -1, PARAM_INT); // Group to display $user = optional_param('user', 0, PARAM_INT); // User to display $date = optional_param('date', 0, PARAM_FILE); // Date to display - number or some string + $startdate = optional_param('startdate', 0, PARAM_FILE); // StartDate to display - number or some string + $finishdate = optional_param('finishdate', 0, PARAM_FILE); // FnishDate to display - number or some string + $startlogdate = optional_param('startlogdate', 0, PARAM_FILE); // StartDate to display - number or some string + $finishlogdate = optional_param('finishlogdate', 0, PARAM_FILE); // FnishDate to display - number or some string $modname = optional_param('modname', '', PARAM_CLEAN); // course_module->id $modid = optional_param('modid', 0, PARAM_FILE); // number or 'site_errors' $modaction = optional_param('modaction', '', PARAM_PATH); // an action as recorded in the logs @@ -68,8 +72,15 @@ } $userinfo = fullname($u, has_capability('moodle/site:viewfullnames', $context)); } - if ($date) { - $dateinfo = userdate($date, get_string('strftimedaydate')); + if ($startdate > $finishdate) { + $startdate = $finishdate; + } + if ($startdate == 0||$finishdate == 0) { + $startdate = $startlogdate; + $finishdate = $finishlogdate; + } + if ($startdate) { + $dateinfo = userdate($startdate, get_string('strftimedaydate')) . ' - ' . userdate($finishdate, get_string('strftimedaydate')); } switch ($logformat) { @@ -86,33 +97,41 @@ id\">$strlogs -> $userinfo, $dateinfo", ''); } - print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")"); - print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); + print_heading("$dateinfo (".usertimezone().")"); + print_mnet_log_selector_form($hostid, $course, $user, $startdate, $finishdate, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); + echo '
'; + if ($startdate == $finishdate){ + print_log_graph($course, $user, "userday.png", $startdate, $finishdate, $modid, $modaction); + } else { + print_log_graph($course, $user, "usercourse.png", $startdate, $finishdate, $modid, $modaction); + } + echo '
'; + if($hostid == $CFG->mnet_localhost_id) { - print_log($course, $user, $date, 'l.time DESC', $page, $perpage, - "index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group", - $modname, $modid, $modaction, $group); + print_log($course, $user, $startdate, $finishdate, 'l.time DESC', $page, $perpage, + "index.php?id=$course->id&chooselog=1&user=$user&startdate=$startdate&finishdate=$finishdate&modid=$modid&modaction=$modaction&group=$group", + $modname, $modid, $modaction, $group); } else { - print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group); + print_mnet_log($hostid, $id, $user, $startdate, $finishdate, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group); } break; case 'downloadascsv': - if (!print_log_csv($course, $user, $date, 'l.time DESC', $modname, + if (!print_log_csv($course, $user, $startdate, $finishdate, 'l.time DESC', $modname, $modid, $modaction, $group)) { notify("No logs found!"); print_footer($course); } exit; case 'downloadasods': - if (!print_log_ods($course, $user, $date, 'l.time DESC', $modname, + if (!print_log_ods($course, $user, $startdate, $finishdate, 'l.time DESC', $modname, $modid, $modaction, $group)) { notify("No logs found!"); print_footer($course); } exit; case 'downloadasexcel': - if (!print_log_xls($course, $user, $date, 'l.time DESC', $modname, + if (!print_log_xls($course, $user, $startdate, $finishdate, 'l.time DESC', $modname, $modid, $modaction, $group)) { notify("No logs found!"); print_footer($course); @@ -135,7 +154,7 @@ print_heading(get_string('chooselogs') .':'); - print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); + print_log_selector_form($course, $user, $startdate, $finishdate, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); echo '
'; print_heading(get_string('chooselivelogs') .':'); Index: report/log/lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/report/log/lib.php,v retrieving revision 1.18.2.3 diff -u -r1.18.2.3 lib.php --- report/log/lib.php 3 Aug 2007 13:18:01 -0000 1.18.2.3 +++ report/log/lib.php 6 Aug 2007 10:38:00 -0000 @@ -1,6 +1,6 @@ set_id($hostid); + $mintime = get_record_sql('SELECT MIN(time) AS logmint FROM ' . $CFG->prefix .'log'); + $log_oldestdate = $mintime->logmint; + $sql = "select distinct course, hostid, coursename from {$CFG->prefix}mnet_log"; $courses = get_records_sql($sql); $remotecoursecount = count($courses); @@ -195,22 +198,32 @@ $timemidnight = $today = usergetmidnight($timenow); // Put today up the top of the list - $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) ); + $dates = array("$timemidnight" => userdate($timenow, $strftimedaydate) ); if (!$course->startdate or ($course->startdate > $timenow)) { $course->startdate = $course->timecreated; } $numdates = 1; - while ($timemidnight > $course->startdate and $numdates < 365) { + while ($timemidnight >= $log_oldestdate and $numdates < 365) { $timemidnight = $timemidnight - 86400; $timenow = $timenow - 86400; $dates["$timemidnight"] = userdate($timenow, $strftimedaydate); $numdates++; } - if ($selecteddate == "today") { - $selecteddate = $today; + if ($startselecteddate == "today") { + $startselecteddate = $today; + } + if ($finishselecteddate == "today") { + $finishselecteddate = $today; + } + if ($startselecteddate == 0||$finishselecteddate == 0) { + $startselecteddate = $timemidnight; + $finishselecteddate = $today; + } + if ($startselecteddate > $finishselecteddate) { + $startselecteddate = $finishselecteddate; } echo "
wwwroot/course/report/log/index.php\" method=\"get\">\n"; @@ -218,6 +231,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; if (has_capability('moodle/site:viewreports', $sitecontext) && $showcourses) { $cid = empty($course->id)? '1' : $course->id; choose_from_menu_nested($dropdown, "host_course", $hostid.'/'.$cid, ""); @@ -228,7 +243,7 @@ if (has_capability('moodle/site:viewreports', $sitecontext)) { $a = new object(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" - ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; + ."&id=$course->id&startdate=$startselecteddate&finishdate=$finishselecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; print_string('logtoomanycourses','moodle',$a); } } @@ -259,28 +274,32 @@ } choose_from_menu($users, 'user', $selecteduser, false); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" - ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses"; + ."&id=$course->id&startdate=$startselecteddate&finishdate=$finishselecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses"; print_string('logtoomanyusers','moodle',$a); } - choose_from_menu ($dates, "date", $selecteddate, get_string("alldays")); choose_from_menu ($activities, "modid", $selectedactivity, get_string("allactivities"), "", ""); choose_from_menu ($actions, 'modaction', $modaction, get_string("allactions")); - $logformats = array('showashtml' => get_string('displayonpage'), 'downloadascsv' => get_string('downloadtext'), 'downloadasods' => get_string('downloadods'), 'downloadasexcel' => get_string('downloadexcel')); choose_from_menu ($logformats, 'logformat', $logformat, false); +echo "
"; + choose_from_menu ($dates, "startdate", $startselecteddate, get_string("alldays")); +echo "->"; + choose_from_menu ($dates, "finishdate", $finishselecteddate, get_string("alldays")); echo ''; echo ''; echo '
'; } - -function print_log_selector_form($course, $selecteduser=0, $selecteddate='today', +function print_log_selector_form($course, $selecteduser=0, $startselecteddate="today", $finishselecteddate="today", $modname="", $modid=0, $modaction='', $selectedgroup=-1, $showcourses=0, $showusers=0, $logformat='showashtml') { global $USER, $CFG; + $mintime = get_record_sql('SELECT MIN(time) AS logmint FROM ' . $CFG->prefix .'log'); + $log_oldestdate = $mintime->logmint; + // first check to see if we can override showcourses and showusers $numcourses = count_records_select("course", "", "COUNT(id)"); if ($numcourses < COURSE_MAX_COURSES_PER_DROPDOWN && !$showcourses) { @@ -410,22 +429,32 @@ $timemidnight = $today = usergetmidnight($timenow); // Put today up the top of the list - $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) ); + $dates = array("$timemidnight" => userdate($timenow, $strftimedaydate) ); if (!$course->startdate or ($course->startdate > $timenow)) { $course->startdate = $course->timecreated; } $numdates = 1; - while ($timemidnight > $course->startdate and $numdates < 365) { + while ($timemidnight >= $log_oldestdate and $numdates < 365) { $timemidnight = $timemidnight - 86400; $timenow = $timenow - 86400; $dates["$timemidnight"] = userdate($timenow, $strftimedaydate); $numdates++; } - if ($selecteddate == "today") { - $selecteddate = $today; + if ($startselecteddate == "today") { + $startselecteddate = $today; + } + if ($finishselecteddate == "today") { + $finishselecteddate = $today; + } + if ($startselecteddate == 0||$finishselecteddate == 0) { + $startselecteddate = $timemidnight; + $finishselecteddate = $today; + } + if ($startselecteddate > $finishselecteddate) { + $startselecteddate = $finishselecteddate; } echo "
wwwroot/course/report/log/index.php\" method=\"get\">\n"; @@ -433,6 +462,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; if (has_capability('moodle/site:viewreports', $sitecontext) && $showcourses) { choose_from_menu ($courses, "id", $course->id, ""); } else { @@ -443,7 +474,7 @@ if (has_capability('moodle/site:viewreports', $sitecontext)) { $a = new object(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" - ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; + ."&id=$course->id&startdate=$startselecteddate&finishdate=$finishselecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; print_string('logtoomanycourses','moodle',$a); } } @@ -475,19 +506,21 @@ choose_from_menu($users, 'user', $selecteduser, false); $a = new object(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" - ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses"; + ."&id=$course->id&startdate=$startselecteddate&finishdate=$finishselecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; print_string('logtoomanyusers','moodle',$a); } - choose_from_menu ($dates, "date", $selecteddate, get_string("alldays")); choose_from_menu ($activities, "modid", $selectedactivity, get_string("allactivities"), "", ""); choose_from_menu ($actions, 'modaction', $modaction, get_string("allactions")); - $logformats = array('showashtml' => get_string('displayonpage'), 'downloadascsv' => get_string('downloadtext'), 'downloadasods' => get_string('downloadods'), 'downloadasexcel' => get_string('downloadexcel')); choose_from_menu ($logformats, 'logformat', $logformat, false); echo ''; +echo "
"; + choose_from_menu ($dates, "startdate", $startselecteddate, get_string("alldays")); +echo "->"; + choose_from_menu ($dates, "finishdate", $finishselecteddate, get_string("alldays")); echo ''; echo '
'; }